Modeling the Two-Body Problem (Earth-Sun)

Setting up Constrainsts, define masses, and necessary laws:

Define Masses:

m1 = Mass of Earth
m2 = Mass of Sun
r1 = position of m1
r2 = position of m2

The center of mass between two bodies (barycenter) :

Rcm=m1r1+m2r2m1+m2

Displacement Vector:

r12=r1r2

r21=r2r1

Newtons Law of universal attraction:

F=Gm1m2r2
Wiki

Vector version of Newtons Law of universal attration (direction property):

F12=Gm1m2r2r^12=Gm1m2r3r12

F21=Gm1m2r2r^21=Gm1m2r3r21

Apply Newton's second law to get acceleration equaitons for each body:

F=ma

Body 1:
m1r¨1=12

Substitute vector gravity formula from above:
m1r1¨1=Gm1m2|r1r2|3(r1r2)

r1¨=Gm2r1r2|r1r2|3

Body 2:
r2¨=Gm1r2r1|r2r1|3

sign flips since r2r1=(r1r2)

Relative position (vector pointing from body 2 to body 1 or coordinate for gravity):

r=r1r2

r˙ = how seperation changes over time
r¨ = acceleration of the seperation, ie, how gravity is curving the motion between the two bodies.

Relative acceleration (r¨):

r¨=r¨1r¨2

r¨=(Gm2r|r|3)(+Gm1r|r|3)

r¨=Gr|r|3(m2+m1)

r¨=G(m1+m2)r|r|3

Model

In [22]:
v_circ = 29784.974926416788 m/s
v0     = 25317.22868745427 m/s  (factor = 0.85 )
v_esc  = 42122.3154958812 m/s
eccentricity e = 0.2775000000000001
e_vec = [-0.2775  0.      0.    ]
r_min = 84607462296.57704
r_max = 149600000000.0
approx eccentricity from min/max: 0.27749985874114835
In [23]:
Out[23]:
In [24]:
Out[24]:
In [ ]: